//app.js

App({

  util: require('./util/util'),

  // 文案

  onLaunch: function () {

    if (!wx.cloud) {
      console.error('请使用 2.2.3 或以上的基础库以使用云能力')
    } else {
      wx.cloud.init({
        evn: 'wedaily-6iwce',
        traceUser: true
      })
    }

    // 登录态判断
    this.globalData.userInfo = wx.getStorageSync('userInfo') == "" ? null : wx.getStorageSync('userInfo');
    console.log('globalData.userInfo', this.globalData.userInfo)
    // 获取屏幕相关数据
    let that = this;
    wx.getSystemInfo({
      success: function (e) {
        let capsule = wx.getMenuButtonBoundingClientRect();
        if (capsule) {
          that.globalData.capsule = capsule     
          that.globalData.navHeight = capsule.bottom + capsule.top - e.statusBarHeight;
        } else {
          that.globalData.navHeight = e.statusBarHeight + 50;
        }
      }
    });

  },


  globalData: {
    setting: null,
    navHeight: 0,
    capsule:null,
    userInfo: null,

  }
})